package com.kbs.im.common.protocol.command;

/**
 * 请求、响应 指令标识枚举
 *
 * @author zhangzhang
 */
public enum Command {

    /**
     * 指令枚举
     */
    //用户登录登出
    USER_LOGIN_REQUEST(10101, "用户登录请求"),
    USER_LOGIN_RESPONSE(10102, "用户登录响应"),
    uSER_LOGOUT_REQUEST(10103, "用户登出请求"),
    USER_LOGOUT_RESPONSE(10104, "用户登出响应"),
    //用户注册
    USER_REGISTER_REQUEST(10111, "用户注册请求"),
    USER_REGISTER_RESPONSE(10112, "用户注册响应"),
    //设备注册
    DEVICE_REGISTER_REQUEST(10121, "设备注册请求"),
    DEVICE_REGISTER_RESPONSE(10122, "设备注册响应"),
    LIST_ALL_DEVICE_REQUEST(10123,"查询所有设备请求"),
    LIST_ALL_DEVICE_RESPONSE(10124,"查询所有设备响应"),
    //用户或设备消息
    MESSAGE_REQUEST(10201, "消息请求"),
    MESSAGE_RESPONSE(10202, "消息响应"),
    //群组
    CREATE_GROUP_REQUEST(10301, "创建群组请求"),
    CREATE_GROUP_RESPONSE(10302, "创建群组响应"),
    LIST_GROUP_MEMBERS_REQUEST(10303, "列举群成员请求"),
    LIST_GROUP_MEMBERS_RESPONSE(10304, "列举群成员响应"),
    JOIN_GROUP_REQUEST(10305, "加入群组请求"),
    JOIN_GROUP_RESPONSE(10306, "加入群组响应"),
    QUIT_GROUP_REQUEST(10307, "退出群组请求"),
    QUIT_GROUP_RESPONSE(10308, "退出群组响应"),
    GROUP_MESSAGE_REQUEST(10309, "群消息请求"),
    GROUP_MESSAGE_RESPONSE(10310, "群消息响应"),
    //心跳检测
    HEARTBEAT_REQUEST(10401, "心跳检测请求"),
    HEARTBEAT_RESPONSE(10402, "心跳检测响应");


    /**
     * 指令码
     */
    private int code;

    /**
     * 指令描述
     */
    private String description;

    Command(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }
}
